-
Notifications
You must be signed in to change notification settings - Fork 20
Draft For-User-Agent implementation #782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Conflicts: # tracing-okhttp3/src/main/java/com/palantir/tracing/OkhttpTraceInterceptor2.java # tracing-okhttp3/src/main/java/com/palantir/tracing/okhttp3/OkhttpTraceInterceptor.java # tracing/src/main/java/com/palantir/tracing/Trace.java # tracing/src/main/java/com/palantir/tracing/Tracer.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a quick scan over this (not terribly thorough). Before implementing this I think we should factor out common tracing state (information which applies to a trace, not individual spans) into a single object that's shared between Trace and DetachedSpan (e.g. traceId and requestId). That way features like this one don't require so much plumbing.
| @Deprecated | ||
| String ORIGINATING_SPAN_ID = "X-OrigSpanId"; | ||
|
|
||
| String FOR_USER_AGENT = "X-For-User-Agent"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: X- prefixes were deprecated several years ago in RFC 6648
| /** | ||
| * The Key under which origin user agents are inserted into SLF4J {@link org.slf4j.MDC MDCs}. | ||
| */ | ||
| public static final String FOR_USER_AGENT_KEY = "__forUserAgent"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this belongs in the MDC, we can find it based on the requestId
|
Closing in favor of #790 |
Before this PR
In this draft tracing-java propagates an additional header across requests which will contain the user agent which was originally used to send a request.
Questions:
Tests are missing